package com.yukino.controller;

import com.yukino.service.DeptService;
import com.yukino.util.AjaxJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
public class DeptController {
    @Autowired
    private DeptService deptService;

    /**
     * 查询所有的部门名
     * @return
     */
    @GetMapping("/dept/name")
    public AjaxJson queryDeptName(){
        return AjaxJson.getSuccessData(deptService.queryDeptName());
    }
}
